<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {

	function __construct(){
		log_message(ETS_INFO, '### C:/admin/login->construct');
		parent::__construct();
		$this->load->library('mylang');
		$this->mylang->load('admin');
	}
	
	public function index()
	{
		log_message(ETS_INFO, '### C:/login->index()');
		
		$role = SESSION_KEY_USER_ROLE_ADMIN;
		$succes_href = site_url('/admin/index');
		$data = array(
				'ajax_login_url' => site_url('ajax/login'),
				'ajax_format_data' => 
					AJAX_PARAM_OPTION.'='.AJAX_PARAM_OPTION_AJAX
					.'&'.AJAX_PARAM_USER_ROLE.'='.$role
					.'&'.AJAX_PARAM_USER_NAME.'={0}'
					.'&'.AJAX_PARAM_USER_PWD.'={1}',
				'success_href' => $succes_href
		);
		$this->load->view('admin/login', $data);
	}
}
